﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ElevateThis
{
    /// <summary>
    /// Represents a single command line argument - keyword + value
    /// </summary>
    public class CommandLineArg
    {
        public CommandLineArg(string keyWord)
        {
            Keyword = keyWord;
            Value = String.Empty;
        }
        
        /// <summary>
        /// Argument values are built up from a sequence of words.  This is because the user might supply
        /// a value at the command line with a space in it
        /// </summary>
        public void AppendValue(string word)
        {
            if (Value == String.Empty)
            {
                // Use supplied
                Value = word;
            }
            else
            {
                // Append supplied, delimiting using a space
                Value += ' ';
                Value += word;
            }
        }

        /// <summary>
        /// Keyword for the option
        /// </summary>
        public string Keyword { get; private set; }

        /// <summary>
        /// Value for the option
        /// </summary>
        public string Value { get; private set; }

    }

}
